package com.github.jave.process;

/**
 * 执行完毕 退出子进程钩子  销毁process
 */
public class KillProcess extends Thread {

    private Process process;

    public KillProcess(Process process) {
        this.process = process;
    }


    @Override
    public synchronized void start() {
        run();
    }

    public void run() {
        ExecProcess.getInstance().removeAllListener();
        if(null != process){
            System.out.println("kill process"+process.toString());
            process.destroy();
        }
    }
}
